package jhub.text;

import java.text.MessageFormat;
import java.text.ParseException;

import jhub.DCProtocol;

public class PrivateChatMessage extends DCRawCommand{
    
    private String othernick;
    private String nick;
    private String message;
    
    public PrivateChatMessage(String command) throws ParseException {
        super(command);
        parse();
    }
    
    private void parse() throws ParseException{
        Object[] o = new MessageFormat(DCProtocol.PRIVATE_CHAT_FORMAT).parse(command.toString());
        othernick = o[0].toString();
        nick = o[1].toString();
        message = o[2].toString();
    }
    
    
    /**
     * @return Returns the othernick.
     */
    public String getOthernick() {
        return othernick;
    }

    public String getNick() {
        return nick;
    }

    public String getMessage() {
        return message;
    }
    
}
